import React from 'react'
import Item from './Item'

import './style.scss'

class List extends React.Component{
    constructor(props){
        super(props)
    }
    render() {
        const data = this.props.data
        return (
            <div className="Item">
                {
                    this.props.title
                    ? <h2>{this.props.title}</h2>
                    : ''
                }
                {
                    data.map((item,index) => {
                      return  <Item key={index} data={item}></Item>
                    })
                }
            </div>
        )
    }
    componentDidMount() {
    }
}

export default List